<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>    
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> 
 
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 
<!--area_lista_autisti.jsp--> 
<script type="text/javascript">

    $(document).ready(function () {
        $('#listCollaboratori').jtable({
        	paging: true,
        	pagesize: 10,
        	pageList: 'minimal',
        	sorting: 'true',
            title: 'Lista Collaboratori',
            toolbar: {
            	 hoverAnimation: true, //Enable/disable small animation on mouse hover to a toolbar item.
            	 hoverAnimationDuration: 60, //Duration of the hover animation.
           	     hoverAnimationEasing: undefined, //Easing of the hover animation. Uses jQuery's default animation ('swing') if set to undefined.
            	    
                items: [{
                    icon: '/images/excel.png',
                    text: 'Export to Excel',
                    click: function () {
                        //perform your custom job...
                    }
                },{
                    icon: '/images/pdf.png',
                    text: 'Export to Pdf',
                    click: function () {
                        //perform your custom job...
                    }
                }]
            },
            actions: {
                listAction: '<%=request.getContextPath()%>/areaPrivata/ajax/loadCollaboratori.html',
                createAction: '<%=request.getContextPath()%>/areaPrivata/ajax/newCollaboratore.html',
                updateAction: '<%=request.getContextPath()%>/areaPrivata/ajax/editCollaboratore.html',
                deleteAction: '<%=request.getContextPath()%>/areaPrivata/ajax/deleteCollaboratore.html'
            },
            fields: {
            	idAutista: {
                    key: true,
                    list: false,
                    create: false,
                    edit: false
                },
                idAutistaUser: {
                    title: 'Id',
                    width: '1%',
                    create: false,
                    edit: false,
                    display: function (data) {
                    	if (data.record) {
                    		return data.record.idAutistaUser;
                    	}
                    }
                },
                Dettaglio: {
                    title: '',
                    sorting: false,
                    edit: false,
                    create: false,
                    width: '1%',
       	             display: function (data) {
       	                 return '<a class="lentina" href="<%=request.getContextPath()%>/areaPrivata/dettaglioCollaboratore.html?id='+data.record.idAutista+'">'+
       	                 			'<img src="<%=request.getContextPath()%>/i/lente.png" height="18" width="18" alt="Visualizza Dettaglio" /></a>';
       	             }
                },
                nome: {
                    title: 'Nome',
					inputClass: 'validate[required] grassetto',
                    width: '20%',


                },   
                tel: {
                    title: 'Telefono',
                    width: '5%'
                },
                email: {
                    title: 'E-mail',
                    width: '5%'
                },                
                note: {
                    title: 'Note',
                    width: '40%',
                    type: "textarea"
                }

                  
                
            },
            //Initialize validation logic when a form is created
            formCreated: function (event, data) {
                data.form.validationEngine();
            },
            //Validate form when it is being submitted
            formSubmitting: function (event, data) {
                return data.form.validationEngine('validate');
            },
            //Dispose validation logic when form is closed
            formClosed: function (event, data) {
                data.form.validationEngine('hide');
                //data.form.validationEngine('detach');
            }
        });
        
        $('#listCollaboratori').jtable('load');

    });
    
    
</script>
			
			
	<!-- INIZIO CONTENUTO -->
				
<div id="listCollaboratori" class="listaJtable"></div>
	<!-- FINE CONTENUTO -->








	</div>
</div>			


<!-- 			<div id="aside"> -->
<!-- 				<h3> -->
<!-- 					Suggerimenti -->
<!-- 				</h3> -->

<!-- 				<h3> -->
<!-- 					Sorgente -->
<!-- 				</h3> -->
<!-- 				<p> -->
<!-- 					Un fornitore rappresenta la provenienza di un servizio, Inserendone uno (o piu' di uno) sara' successivamente possibile assegnargli dei servizi  -->
<!-- 				</p> -->

<!-- 			</div> -->
			





















<%-- 



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>    
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>  

    <!-- content -->		
			<div id="content" align="center">
			
			
				<h2>Lista Autisti </h2>
				<br />
				<br />
				<br />
				<div align="center"> <a class="bottone" href="inserisciAutista.html">Inserisci Autista</a></div>
					<display:table name="dettaglio.listaAutisti" id="a" requestURI="listaAutisti.html" pagesize="40" export="true" >
						<display:column title="Nome" sortable="true" headerScope="col" media="html">
							<a href="listaServiziAutista.html?id_autista=<c:out value="${a.idAutista}" />&nome_aut=<c:out value="${a.nome}" />" ><c:out value="${a.nome}" /> </a>
						</display:column>
						<display:column title="Nome Autista" sortable="true" headerScope="col" media="excel pdf"><c:out value="${a.nome}" /></display:column>						
						<display:column title="Tel." sortable="true" headerScope="col"><c:out value="${a.tel}"/></display:column>
						<display:column title="Email" sortable="true" headerScope="col"><c:out value="${a.email}"/></display:column>
						<display:column title="Oper" sortable="true" headerScope="col" media="html">
					 		<a href="modificaAutista.html?id_autista=<c:out value="${a.idAutista}" />" ><img src="<%=request.getContextPath()%>/images/modifica.gif" alt="MODIFICA"/></a>
					 		<a onClick="return elimina()"; href="listaAutisti.html?oper=elimina&id_autista=<c:out value="${a.idAutista}" />"><img src="<%=request.getContextPath()%>/images/elimina.gif" alt="ELIMINA" /></a>
						</display:column>
						 <display:footer media="excel pdf html">
							 <div>
							 <tr style="background-color: silver; color: black; font-size: 0.7em">
								 	<td colspan="12"align="right">&nbsp;</td>
				 			 </tr>
			 			 	</div>
				 			 
						 </display:footer>						
				</display:table>		
								<br /><br />
					<div class="button">
						<a class="bottone" href="listaServizi.html" />Indietro </a> 
					</div>			

					
				<br /><br />

				
				<br /><br /><br /><br /><br /><br />
				<br /><br /><br /><br /><br /><br />
			</div>
			<div id="aside">
				<h3>
					Suggerimenti
				</h3>

				<h3>
					Autista
				</h3>
				<p>
					Inserendo un autista sara' successivamente possibile assegnarli un servizio per tenere conto dei servizi che gli hai passato
				</p>

			</div>
			 --%>